public class Cat extends Animal implements Terrestrial{
    private int LegNum;
    public Cat() {
    }

    public Cat(String name) {
        super(name);

    }

    public Cat(String name, int legNum) {
        super(name);
        LegNum = legNum;
    }

    public int getLegNum() {
        return LegNum;
    }

    public void setLegNum(int legNum){
        if (legNum == 4) {
            LegNum = legNum;
        } else {
            throw new CatException("错误，猫只能有四条腿");
        }
    }
    public void shout() {
        System.out.println("猫喵喵喵的叫。。。。");
    }


}
